From de9c96ad431619c2e26bea627b740c3c691ffd89 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 18 Jan 2007 17:26:11 +0000 Subject: [PATCH] Fix typos and think-os to make byte swapping actually swap bytes. --- alan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alan.c b/alan.c index a93c66175..aa8f1b883 100644 --- a/alan.c +++ b/alan.c @@ -214,7 +214,7 @@ static void sw_bytes(void *word) { uint8_t *p = word; uint16_t *r = word; - *r = (uint16_t)(p[0] << 8 | p[1]); + *r = (uint16_t)(p[1] << 8 | p[0]); } static void sw_words(void *dword) { uint16_t *p = dword; @@ -226,7 +226,7 @@ static void rev_bytes(void *dword) { uint8_t *p = dword; uint32_t *r = dword; - *r = (uint32_t)(p[0] << 24 | p[1] << 16 | p[2] << 8 | p[0]); + *r = (uint32_t)(p[3] << 24 | p[2] << 16 | p[1] << 8 | p[0]); } static void swap_wpthdr(struct wpthdr *wpthdr, -- 2.30.2